package com.es.www.kyl.util;

import java.math.BigDecimal;
import java.util.Objects;

public class DecimalUtil {

    public static String formatDecimal(BigDecimal decimal){
        if(Objects.nonNull(decimal)){
            return decimal.stripTrailingZeros().toPlainString();
        }
        return "";
    }


    public static void main(String[] args) {
        System.out.println(DecimalUtil.formatDecimal(BigDecimal.valueOf(100.0000)));
    }
}
